<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <title>实例讲解angular操作checkbox复选框</title>
    <style>
        .ng-cloak{
            display: none;
        }
    </style>
</head>
<body>
<div ng-app="tinywan" ng-controller="ctrl">
   <h1>游戏选择</h1>
    游戏：<input type="checkbox" ng-model="data.game" ng-true-value="1" ng-false-value="0"><br/>
    视频：<input type="checkbox" ng-model="data.video" ng-true-value="1" ng-false-value="0"><br/>
    直播：<input type="checkbox" ng-model="data.live" ng-true-value="1" ng-false-value="0"><br/>
    <h1>{{data}}</h1>
    <div ng-show="data.game==1">
        <h2>游戏内容:</h2>
        <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
    <div ng-show="data.video==1">
        <h2>视频内容:</h2>
        <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
    <div ng-show="data.live==1">
        <h2>视频内容:</h2>
        <textarea name="" id="" cols="30" rows="10"></textarea>
    </div>
</div>

<script>
    var module = angular.module('tinywan', []);
    module.controller('ctrl', ['$scope', function ($scope) {
        $scope.data = {'game':0,'video':0,'live':0};
    }]);
</script>
</body>
</html>


